<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/4/11
  Time: 16:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="../../js/jquery-3.6.0.js" type="text/javascript"></script>
</head>
<body>

    用户名：<input type="text" name="name" id="yhm"><br>
    密码：<input type="password" name="passwd" id="mm"><br>
    出生日期:<input type="text" name="birthday" id="day">
    <input type="button" value="注册" onclick="reg()">
<script>
    function reg() {
        var yhm=$("#yhm").val();
        var mm=$("#mm").val();
        var day=$("#day").val();
        var req={"name":yhm,"passwd":mm,"birthday":day};
        $.ajax({
            url:"/test17",
            type:"post",
            dataType:"json",
            contentType:"application/json;charset=UTF-8",
            data:JSON.stringify(req),
            success:function (res) {
                var  pt=res[0].name+":"+res[0].passwd+":"+res[0].birthday;
                    alert(pt);
                console.log(res);
            },
            error:function (res) {
                alert(res);
                console.log(res);
            }
        });
    }
</script>
</body>
</html>
